Film grain technology (FGT) is a video specification provided by the Society of Motion Picture and Television Engineers (SMPTE). FGT is capable of allowing, video output appear as film. In particular, FGT allows film grain to be added to decoded frames of such video. Utilizing FGT, the film grain is added to the frames e.g. bitstream, etc.) after the decoding of such frames, but prior to display.
Further, FGT utilizes a film grain database (FGDB). The FGDB is composed of 169 patterns of 4,096 film grain samples, where each film grain sample represents a 64×64-byte film grain image. Accordingly, the size of the FGDB is 64×64×169 (i.e. 692,224 bytes).
FIG. 1 illustrates a memory block 100 in which a film grain image is stored, in accordance with the prior art. As shown in FIG. 1, portions of memory 102 are stored serially within the memory block 100. Each portion of memory 102 thus includes a portion of the film grain image. Further, each portion of memory 102 is 4×1-bytes. Accordingly, a 64×64-byte film grain image is comprised of a plurality of 4×1-byte portions that are serially stored in memory. Moreover, each 4×1-byte portion may include 4 1×1-byte addresses stored therein.
Generally, for an 8×8-byte portion (e.g. of a Luma surface, Chroma surface, etc.), FGT requires an 8×8-byte sample from one 64×64-byte film grain image. The horizontal and vertical offsets within the 64×64-byte film grain image are traditionally calculated utilizing the formula shown in Table 1.
TABLE 1k_offset = (MSB16(x(r, ec)) % 52)k_offset &= 0xFFFCk_offset += m & 0x0008l_offset = (LSB16(x(r, ec)) % 56)l_offset &= 0xFFF8l_offset += n & 0x0008
As shown in Table 1, the (MSB16(x(r, ec)) and (LSB16(x(r, ec)) are calculated from a predefined random seed. In addition, the (m, n) is the coordinate of the top-left corner of the memory block 100 in a decoded frame. Since the memory block 100 stores portions thereof serially, at least eight (8) read requests must be utilized, where each read request is 8 bytes, in order to read an 8×8-byte portion of the memory block 100 (e.g. sixteen 4×1-byte portions of the memory block 100).
In use, the FGDB is generated by a software driver. Furthermore, such FGDB may be generated only once. FIG. 2 illustrates a method 200 for reading portions of memory stored serially in an FGDB, in accordance with the prior art. As shown in operation 202, a video driver generates an FGDB. Additionally, the FGDB is stored in memory, as shown in operation 204. As described above with respect to FIG. 1, portions of the film grain images are stored serially within the FGDB.
Still yet, as shown in operation 206, eight starting addresses within the FGDB are calculated. Such starting addresses may each be associated with one of the portions of the file grain image. Moreover, eight 8-byte read requests are issued with respect to such starting addresses in order to receive an 8×8-byte block of memory within the FGDB. See operation 208. In particular, the eight read requests are required due to the serial configuration of the portions of the film grain image within the FGDB (as shown in FIG. 1). Finally, FGT processes the 8×8-byte block of memory within the FGDB, as shown in operation 210.
To this end, a plurality of read requests (e.g. 8 read requests) must be issued in order to access a single 8×8-byte block of memory within the FGDB. Unfortunately, utilizing numerous read requests in this manner is inefficient, particularly for high performance processors [e.g. graphics processing units (GPUs), etc.] with high latency.
There is thus a need for addressing these and/or other issues associated with the prior art.